Northwoods.GoSilverlight 2.2.4 Assembly
CopyNode2 Method
See Also  Send Feedback
Northwoods.GoXam.Model Namespace > GraphLinksModel<NodeType,NodeKey,PortKey,LinkType> Class : CopyNode2 Method

oldnodedata
the original node data
env
the dictionary mapping original objects to copied objects
newnodedata
the copied node data
newgroup
for convenience, the copied "parent" node data
newmembers
for convenience, a list of newly copied member nodes

Glossary Item Box

This is the second pass of copying node data, responsible for fixing up references to other objects.

Syntax

Visual Basic (Declaration) 
Protected Overridable Sub CopyNode2( _
   ByVal oldnodedata As NodeType, _
   ByVal env As GraphLinksModel(Of NodeType,NodeKey,PortKey,LinkType), _
   ByVal newnodedata As NodeType, _
   ByVal newgroup As NodeType, _
   ByVal newmembers As IEnumerable(Of NodeType) _
) 

Parameters

oldnodedata
the original node data
env
the dictionary mapping original objects to copied objects
newnodedata
the copied node data
newgroup
for convenience, the copied "parent" node data
newmembers
for convenience, a list of newly copied member nodes

Remarks

You will want to override this method if the node data should have any references to copied data. Otherwise the copied node will appear to have links to the original nodes, not to the copied nodes.

Your overridden method may want to do something like what this method does by default: // this assumes the node data has a reference to its container group if (this.GroupNodePath != "" && newgroup != null) { ModifyGroupNodeKey(newnodedata, FindKeyForNode(newgroup)); } // this assumes there's a modifiable collection that InsertMemberNodeKey can work with; // if not, you could instead construct your own list and call ModifyMemberNodeKeys. if (this.MemberNodesPath != "" && newmembers != null) { // remove any old keys; not needed if the copied property value is empty foreach (NodeKey k in FindMemberNodeKeysForNode(newnodedata).OfType<NodeKey>().ToList()) { DeleteMemberNodeKey(newnodedata, k); } // add new keys (which should be different from the old keys) foreach (NodeType newmem in newmembers) { NodeKey newmemkey = FindKeyForNode(newmem); InsertMemberNodeKey(newnodedata, newmemkey); } }

Requirements

See Also

© 2017 All Rights Reserved.